long? catCode = null; // Если строка val не пустая, if (!(String.IsNullOrWhiteSpace(val))) { // распознаем в первых цифрах до пробела целое 64-битное число. // Если его там нет, записываем в catCode NULL. // Если его удалось распознать, записываем его в catCode. if (!(Int64.TryParse(val.Split(" ")[0], out long cc))) { catCode = null; } else { catCode = cc; } }
Как переписать этот код чуть понятнее?
⏩Как вариант, можно написать что-то в духе:
public static string LeftDigits(this string str) { if (str == null) return null; if (!str.contains(" ") return null; string left = str.Split(" ")[0]; if (! left.All(Char.IsDigit){ return null; } return left; }
long? catCode = null; // Если строка val не пустая, if (!(String.IsNullOrWhiteSpace(val))) { // распознаем в первых цифрах до пробела целое 64-битное число. // Если его там нет, записываем в catCode NULL. // Если его удалось распознать, записываем его в catCode. if (!(Int64.TryParse(val.Split(" ")[0], out long cc))) { catCode = null; } else { catCode = cc; } }
Как переписать этот код чуть понятнее?
⏩Как вариант, можно написать что-то в духе:
public static string LeftDigits(this string str) { if (str == null) return null; if (!str.contains(" ") return null; string left = str.Split(" ")[0]; if (! left.All(Char.IsDigit){ return null; } return left; }
Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.
At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?